import Vue from 'vue'
import App from './App.vue'
import VueCookie from 'vue-cookie'            // api: https://github.com/alfhen/vue-cookie
import { isAuth, dateFormat2 } from '@/utils'
import httpRequest from '@/utils/theHttp'
import router from './router'
import store from '@/store'
import cloneDeep from 'lodash/cloneDeep'

//iview ui
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';

//打开debug
Vue.config.devtools = true

Vue.use(VueCookie)
Vue.use(ViewUI);

// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth     // 权限方法
Vue.prototype.dateFormat = dateFormat2  // 格式化时间

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')


